<template>
  <div>
    <input type="button" value="点击添加" @click="open=true">
    <!-- <Teleport to="body"> -->
      <Toast v-if="open" @getOpen="openFn" />
    <!-- </Teleport> -->
  </div>
</template>

<script>
import Toast from "./Toast.vue";
export default {
  components:{
    Toast
  },
  data() {
    return {
      open: false
    }
  },
  methods:{
    openFn(v){
      this.open = v;
    }
  }
}
</script>